package com.admin.interfaces.facade.dto;

import com.admin.domain.modle.Play;
import org.springframework.beans.BeanUtils;

/**
 * 演出接口dto
 *
 * @author LeeJun
 * @create 2017-04-17 20:51
 */
public class PlayDTO {

    private Integer id;
    private Integer minPrice;
    private String name;
    private Integer status;
    private PlayDate playDate;

    public PlayDate getPlayDate() {
        return playDate;
    }

    public void setPlayDate(PlayDate playDate) {
        this.playDate = playDate;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getMinPrice() {
        return minPrice;
    }

    public void setMinPrice(Integer minPrice) {
        this.minPrice = minPrice;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Play converToPlay() {
        Play play = new Play();
        BeanUtils.copyProperties(this, play);
        StringBuilder playDate = new StringBuilder();
        // yyyy-MM-dd
        if (null != this.getPlayDate()) {
            playDate.append(this.getPlayDate().getYear()).append("-").append(this.getPlayDate().getMonth()).append("-").append(this.getPlayDate().getDay()).append(" ")
                    .append(this.getPlayDate().getHours()).append(":").append(this.getPlayDate().getMinutes()).append(":").append(this.getPlayDate().getSeconds());
        }
        play.setPlayDate(playDate.toString());
        return play;
    }

    public class PlayDate {
        private int date;
        private int hours;
        private int seconds;
        private int month;
        private long timezoneOffset;
        private int year;
        private int minutes;
        private int day;
        private long time;

        public int getDate() {
            return date;
        }

        public void setDate(int date) {
            this.date = date;
        }

        public int getHours() {
            return hours;
        }

        public void setHours(int hours) {
            this.hours = hours;
        }

        public int getSeconds() {
            return seconds;
        }

        public void setSeconds(int seconds) {
            this.seconds = seconds;
        }

        public int getMonth() {
            return month;
        }

        public void setMonth(int month) {
            this.month = month;
        }

        public long getTimezoneOffset() {
            return timezoneOffset;
        }

        public void setTimezoneOffset(long timezoneOffset) {
            this.timezoneOffset = timezoneOffset;
        }

        public int getYear() {
            return year;
        }

        public void setYear(int year) {
            this.year = year;
        }

        public int getMinutes() {
            return minutes;
        }

        public void setMinutes(int minutes) {
            this.minutes = minutes;
        }

        public int getDay() {
            return day;
        }

        public void setDay(int day) {
            this.day = day;
        }

        public long getTime() {
            return time;
        }

        public void setTime(long time) {
            this.time = time;
        }
    }
}
